Skip to content

test: verify bounded output token budget and JSON response format (#202) - #371

Merged
ashrafee-dev merged 1 commit into
ashrafee-dev:mainfrom
HenriqueLopes741:test/output-token-limit
Sep 28, 2026
Merged

ashrafee-dev merged 1 commit into
ashrafee-dev:mainfrom
HenriqueLopes741:test/output-token-limit

Conversation

@HenriqueLopes741

Copy link
Copy Markdown
Contributor

Summary

  • Add a focused test file (tests/roadmap/provider/test_output_token_limit.py) covering two request
    parameters sent to the DeepSeek client in ask_deepseek that were previously untested.
  • Verify max_tokens is a positive, bounded integer, protecting the provider response-token budget.
  • Verify response_format requests structured JSON, since get_assessment relies on
    riskAssessment.model_validate(response) parsing a valid JSON payload.

Test plan

  • uv run pytest tests/roadmap/provider/test_output_token_limit.py -q
  • uv run pylint app tests
  • bash scripts/check.sh

Closes #202

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@HenriqueLopes741 is attempting to deploy a commit to the ashrafee-dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@HenriqueLopes741

Copy link
Copy Markdown
Contributor Author

Hi @ashrafee-dev ! This is my first contribution here

I'm Henrique, a Computer Science student from Brazil, currently focused on software development, backend, and cloud technologies. I'm also getting more involved with open source and looking for opportunities to learn by contributing to real-world projects.

I picked this issue from the contributor roadmap as a way to get familiar with the codebase — specifically the DeepSeek integration in app/services/ai.py and how the test suite mocks the provider client.

Happy to adjust the approach if there's a preferred pattern I missed, and I'm looking forward to picking up more issues from the roadmap and contributing to the project!

@ashrafee-dev
ashrafee-dev merged commit 1021e94 into ashrafee-dev:main Sep 28, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protect the provider response-token budget

2 participants